package com.scuthnweb.action.reslinkmodule;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.scuthnweb.domain.Share_link;
import com.scuthnweb.service.ResLinkModule;

public class CheckUserResLinkForModifyAction extends ActionSupport{	
	private Integer sid;
	
	private ResLinkModule resLinkModule;

	public String execute(){
		ActionContext ctx = ActionContext.getContext();
		Share_link share_link = this.resLinkModule.checkResLink(sid);
		Integer uid = (Integer)ctx.getSession().get("user_id");
		if( uid==null || uid.intValue()!=share_link.getPoster_account().getId().intValue()){
			return ERROR;
		}else{
			ctx.getSession().put("linkInfo", share_link);
			return SUCCESS;
		}
	}

	public Integer getSid() {
		return sid;
	}

	public void setSid(Integer sid) {
		this.sid = sid;
	}

	public ResLinkModule getResLinkModule() {
		return resLinkModule;
	}

	public void setResLinkModule(ResLinkModule resLinkModule) {
		this.resLinkModule = resLinkModule;
	}
}
